import { _decorator, Component, director, Input, Node } from 'cc';
import { NodeName } from '../utils/common';
const { ccclass, property } = _decorator;

@ccclass('SuccessWidgetControl')
export class SuccessWidgetControl extends Component {
    private jump_link_node: Node = null;
    protected onLoad(): void {
        this.jump_link_node = this.node.getChildByName(NodeName.CreateLiveRoomSuccessScene.Label.SuccessJumpLinkLabel);
        if (this.jump_link_node !== null && this.jump_link_node !== undefined) {
            this.jump_link_node.on(Input.EventType.TOUCH_END, this.onSuccessJumpLinkLabelTouchEnd, this);
        }
    }
    protected onDestroy(): void {
        if (this.jump_link_node !== null && this.jump_link_node !== undefined && this.jump_link_node.name.length) {
            this.jump_link_node.off(Input.EventType.TOUCH_END, this.onSuccessJumpLinkLabelTouchEnd, this);
        }
    }
    onSuccessJumpLinkLabelTouchEnd(){
        director.loadScene('LiveRoomScene');
    }
}


